using System.Collections;
using System.Collections.Generic;
using Spine;
using Spine.Unity;
using UnityEngine;

public class Lesson45 : MonoBehaviour
{
    private SkeletonAnimation sa;
    [SpineAnimation]
    public string jumpName;
    [SpineBone]
    public string boneName;
    [SpineSlot]
    public string slotName;
    [SpineAttachment]
    public string attachmentName;
    // Start is called before the first frame update
    void Start()
    {
        sa=this.GetComponent<SkeletonAnimation>();

        sa.AnimationState.SetAnimation(0, jumpName, false);
        sa.AnimationState.AddAnimation(0, jumpName, false, 0);

        sa.skeleton.ScaleX = 1;

        sa.AnimationState.Start += (t) =>
        {

        };
        sa.AnimationState.End += (t) =>
        {

        };
        sa.AnimationState.Complete += (t) =>
        {

        };
        sa.AnimationState.Event += (t, e) =>
        {

        };


        Bone b=sa.skeleton.FindBone(boneName);
        sa.skeleton.SetAttachment(slotName, attachmentName);
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
